package com.example.demo.request;

import com.example.demo.common.BaseRequest;
import com.example.demo.common.CheckedException;
import com.example.demo.response.EditResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class EditRequest extends BaseRequest<EditResponse> {

    @Valid
    @NotNull
    private Campaign campaign;

    @Override
    public Class<EditResponse> getResponseClass() {
        return EditResponse.class;
    }

    @Override
    public String getApiMethodName() {
        return null;
    }

    @Override
    public void check() throws CheckedException {

    }

    @Data
    public static class Campaign {
        @NotNull
        private Long campaignId;
        @NotNull
        private Long campaignType;
        @NotEmpty
        private String campaignName;
        @Valid
        @NotEmpty
        private List<Adgroup> adgroupList;
    }

    @Data
    public static class Adgroup {
        @NotNull
        private Long adgroupId;
        @NotNull
        private Long adgroupType;
        @NotEmpty
        private String adgroupName;
    }
}
